Public Class RotateFOrm



    Private Sub RotateFOrm_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
        Dim myPen As New System.Drawing.Pen(System.Drawing.Color.Blue, 1)
        Dim myPen2 As New System.Drawing.Pen(System.Drawing.Color.Red, 1)

        Dim startpunt As New System.Drawing.Point
        startpunt.X = 100
        startpunt.Y = 100

        Dim Plaatje As System.Drawing.Image
        Plaatje = Me.ImageList1.Images(0)

        'teken eerst een plaatje
        e.Graphics.DrawImage(Plaatje, startpunt)

        ' Create a matrix and rotate it 45 degrees.
        Dim x As Integer
        Dim myMatrix As New Drawing.Drawing2D.Matrix
        For x = 0 To 90 Step 5
            myMatrix.Rotate(x, Drawing.Drawing2D.MatrixOrder.Append)
            e.Graphics.Transform = myMatrix

            ' Draw the plaatej to the screen again after applying the transform.
            e.Graphics.DrawImage(Plaatje, startpunt)
            e.Graphics.Clear(Drawing.Color.PowderBlue)
        Next





    End Sub

    Private Sub RotateFOrm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class